package com.gxa.dao;

import com.gxa.pojo.Project;
import com.gxa.pojo.ProjectV;
import com.gxa.pojo.ProjectVO;
import io.swagger.annotations.ApiParam;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface ProjectMapper {


    @Select("select * from project limit ${begin},${limit}")
    List<Project> showAllProject(ProjectV projectV);

    int getCount();

    @Insert("INSERT INTO project(projectManagementId,projectName,projectAddres,projectNumber,projectType,userType,projectStatus,startTime,onlineTime,\n" +
            "commencementReport,acceptanceReport,installationDrawings,manual,equipmentReport,equipmentList) \n" +
            "VALUES(#{projectManagementId},#{projectName},#{projectAddres},#{projectNumber},#{projectType},#{userType},#{projectStatus},#{startTime},#{onlineTime},#{commencementReport},#{acceptanceReport},#{installationDrawings},#{manual},#{equipmentReport},#{equipmentList})")
    int  addProject(Project project);

    List<Project> selectByCondition(ProjectV projectV);

    @Delete("DELETE FROM project where projectNumber=#{ProjectNumber}")
    int deleteByProjectNumber(String ProjectNumber);

    @Select("select * from project where projectNumber=#{projectNumber}")
    Project selectByProjectNumber(String projectNumber);

}
